<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
    <title>各种控件的例子</title>

    <link rel="icon" type="image/png" href="/img/icon.png">

    <script type="text/javascript" src="/h5/newall/newall.js"></script>


    <script type="text/javascript" src="/h5/js/all2.js"></script>

    <link rel="stylesheet" type="text/css" href="/h5/newall/newall.css">


</head>
<body>

<div class="mui-content-padded H5body" id="headPicBody">

    <MCform id="jobForm"
            class="mctag formSet">
        <MCtitle class="mctag">充值页面</MCtitle>
        <div class="content">

            <ul style="padding-bottom: 0" class="baseul">
                <li class="li">
                    <p title="title">充值金额</p>
                    <input type="number" placeholder="请输入充值金额" mcname="money" value="0.01" class="mui-input"/>
                </li>
            </ul>

            <div class="mui-input-rowtable">
                <label>当前余额</label>
                <a class="zhuangtai ">
                    <span mcname="nowmoney" defaultval="🕑" class="zhuangtaiP">{{nowmoney}}元</span>
                </a>
            </div>

            <div pay="zhifubao" class="mui-input-rowtable">
                <label>支付宝</label>
                <a class="zhuangtai ">
                    <i class="rightico"></i>
                </a>
            </div>
            <div pay="weixin" class="mui-input-rowtable">
                <label>微信</label>
                <a class="zhuangtai ">
                    <i class="rightico"></i>
                </a>
            </div>
        </div>
    </MCform>


</div>
<style>

</style>


<script>
    var view = new MC.View.MCform('#jobForm');
    $('[pay]').on('click',function(){
        var obj=$(this);
        var pay=obj.attr("pay");
        MC.apiD("createpayhref",{
            pay_type:pay,
            money:$('[mcname=money]').val()
        },function(href){
            window.open(href,"_self");
        });
        console.log(pay,view.vue.money);
    });

    MC.apiD("getUserMoney",{},function(data){
        console.log(data);
        view.vue.nowmoney=data.money;
    });


</script>
</body>
</html>